unit uTrocaN_INSC;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, Buttons, dxCore, dxButton;

type
  TfTrocaN_INSC = class(TForm)
    RadioButton1: TRadioButton;
    RadioButton2: TRadioButton;
    RadioButton3: TRadioButton;
    btnCancela: TdxButton;
    btnConfirma: TBitBtn;
    Label1: TLabel;
    procedure FormShow(Sender: TObject);
    procedure btnCancelaClick(Sender: TObject);
    procedure btnConfirmaClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  fTrocaN_INSC: TfTrocaN_INSC;

implementation

uses uSocios, uMostra_Insc_vazia;

{$R *.dfm}

procedure TfTrocaN_INSC.FormShow(Sender: TObject);
begin
  if(fSocios.ComboBox3.Text = 'PIRASSUNUNGA')then
  begin
    RadioButton1.Enabled := False;
  end;

  if(fSocios.ComboBox3.Text = 'ANALANDIA')then
  begin
    RadioButton2.Enabled := False;
  end;

  if(fSocios.ComboBox3.Text = 'SANTA CRUZ')then
  begin
    RadioButton3.Enabled := False;
  end;


end;

procedure TfTrocaN_INSC.btnCancelaClick(Sender: TObject);
begin
  close;
end;

procedure TfTrocaN_INSC.btnConfirmaClick(Sender: TObject);
begin
  fMostra_Insc_vazia := TfMostra_Insc_vazia.Create(Application);
  try
  if(RadioButton1.Checked = True ) then
  begin
    fMostra_Insc_vazia.ComboBox1.Text := 'PIRASSUNUNGA';
  end;

  if(RadioButton2.Checked = True ) then
  begin
    fMostra_Insc_vazia.ComboBox1.Text := 'ANALANDIA';
  end;

  if(RadioButton3.Checked = True ) then
  begin
    fMostra_Insc_vazia.ComboBox1.Text := 'SANTA CRUZ';
  end;

    fMostra_Insc_vazia.Label4.Caption := fMostra_Insc_vazia.ComboBox1.Text;
    fMostra_Insc_vazia.ComboBox1.Visible := False ;

    if (fMostra_Insc_vazia.ComboBox1.Text = '') then
    begin
      MessageDlg('Escolha uma Unidade', mtWarning, [mbOK], 0);
    exit;
    end;

    fMostra_Insc_vazia.btnLista.click;
    fMostra_Insc_vazia.ShowModal;

  finally
    fMostra_Insc_vazia.Free;
  end;
   fTrocaN_INSC.Close;
end;

end.
